/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans CJK SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}

.logo h1 {
    color: #ff3955;
    font-size: 24px;
    font-weight: bold;
}

.search-container {
    flex: 1;
    max-width: 500px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid #ff3955;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #e6334a;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: #ff3955;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: #e6334a;
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.user-link:hover {
    color: #ff3955;
    background: rgba(255, 57, 85, 0.1);
}

.user-link svg {
    width: 18px;
    height: 18px;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    width: 30px;
    height: 24px;
    justify-content: space-between;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: #ff3955;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.main-nav a {
    color: #333;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #ff3955;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff3955;
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

/* 轮播图样式 */
.banner {
    background: linear-gradient(135deg, #ff3955 0%, #ff6b85 100%);
    padding: 40px 0;
}

.banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
}

.banner-slider {
    position: relative;
    height: 300px;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.banner-item.active {
    opacity: 1;
}

.banner-content {
    display: flex;
    height: 100%;
    background: white;
}

.banner-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-info {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.banner-info h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.banner-info .author {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.banner-info .desc {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.read-btn {
    display: inline-block;
    background: #ff3955;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.read-btn:hover {
    background: #e6334a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 57, 85, 0.4);
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: white;
}

/* 主要内容区域 */
.main-content {
    padding: 30px 0;
}

.section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ff3955;
    padding-left:10px;
}

.section-header h2 {
    font-size: 24px;
    color: #333;
    position: relative;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #ff3955;
    border-radius: 2px;
}

.more-link {
    color: #ff3955;
    font-weight: 500;
    transition: color 0.3s ease;
}

.more-link:hover {
    color: #e6334a;
}

/* 书籍网格 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.book-cover {
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
    font-weight: bold;
}

.book-author {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.book-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-meta .category {
    background: rgba(255, 57, 85, 0.1);
    color: #ff3955;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.book-meta .status {
    color: #999;
    font-size: 12px;
}

/* 更新列表 */
.update-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.update-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.update-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.update-item a {
    display: flex;
    align-items: center;
    gap: 15px;
}

.update-cover {
    flex-shrink: 0;
}

.update-cover {
    flex-shrink: 0;
    width: 50px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}

.update-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.update-info {
    flex: 1;
}

.update-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    font-weight: bold;
}

.update-chapter {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.update-time {
    color: #999;
    font-size: 12px;
}

/* 精品推荐样式 */
.featured-books {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.featured-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.featured-book {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.featured-book:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.featured-book a {
    display: flex;
    height: 100%;
}

.featured-cover {
    width: 120px;
    flex-shrink: 0;
    overflow: hidden;
}

.featured-cover img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-book:hover .featured-cover img {
    transform: scale(1.05);
}

.featured-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.featured-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

.featured-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.featured-meta .author {
    color: #999;
}

.featured-meta .category {
    background: rgba(255, 57, 85, 0.1);
    color: #ff3955;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* 侧边推荐 */
.side-recommendations {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.side-recommendations h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff3955;
    position: relative;
}

.side-recommendations h3::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background: #ff3955;
}

.side-book-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.side-book-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.side-book-item:hover {
    background-color: white;
    border-color: #ff3955;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 57, 85, 0.15);
}

.category-tag {
    background: rgba(255, 57, 85, 0.1);
    color: #ff3955;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.side-book-item a {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.3s ease;
    flex: 1;
}

.side-book-item a:hover {
    color: #ff3955;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    border-color: #ff3955;
    color: #ff3955;
    background: rgba(255, 57, 85, 0.1);
}

.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.book-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.book-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.book-item a {
    display: flex;
    gap: 15px;
}

.book-item-cover {
    flex-shrink: 0;
}

.book-item-cover {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
}

.book-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-item-info {
    flex: 1;
}

.book-item-info h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    font-weight: bold;
}

.book-item-info .author {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.book-item-info .intro {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 底部样式 */
.footer {
    background: #333;
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #ff3955;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-section a {
    color: #ccc;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ff3955;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #999;
    font-size: 14px;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        max-width: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .main-nav.show {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 20px;
        border-top: none;
    }
    
    .main-nav a {
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }
    
    .banner {
        padding: 20px 0;
    }
    
    .banner-slider {
        height: 250px;
    }
    
    .banner-content {
        flex-direction: column;
    }
    
    .banner-image {
        height: 120px;
    }
    
    .banner-info {
        padding: 20px;
    }
    
    .banner-info h2 {
        font-size: 20px;
    }
    
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .update-list {
        grid-template-columns: 1fr;
    }
    
    .book-list {
        grid-template-columns: 1fr;
    }
    
    .category-tabs {
        justify-content: center;
    }
    
    .featured-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .featured-book a {
        flex-direction: column;
    }
    
    .featured-cover {
        width: 100%;
        height: 200px;
    }
    
    .featured-cover img {
        height: 200px;
    }
    
    .featured-info {
        padding: 15px;
    }
    
    .side-recommendations {
        margin-top: 15px;
        padding: 15px;
    }
    
    .side-book-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .side-book-item {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .user-actions {
        gap: 10px;
    }
    
    .user-link span {
        display: none;
    }
    
    .banner-slider {
        height: 200px;
    }
    
    .banner-info {
        padding: 15px;
    }
    
    .banner-info h2 {
        font-size: 18px;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .book-info {
        padding: 15px;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .tab-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .featured-book a {
        flex-direction: column;
    }
    
    .featured-cover {
        width: 100%;
        height: 180px;
    }
    
    .featured-cover img {
        height: 180px;
    }
    
    .featured-info {
        padding: 12px;
    }
    
    .featured-title {
        font-size: 15px;
    }
    
    .featured-desc {
        font-size: 13px;
    }
    
    .side-recommendations {
        padding: 12px;
    }
    
    .side-recommendations h3 {
        font-size: 16px;
    }
    
    .side-book-item a {
        font-size: 13px;
    }
    
    .side-book-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .side-book-item {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeInUp 0.6s ease forwards;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ff3955;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e6334a;
}